function getTime() {
var now = new Date(); var hh = ('0' + now.getHours()).slice(-2); var mm = ('0' + now.getMinutes()).slice(-2); var ss = ('0' + now.getSeconds()).slice(-2); nowtime = hh + ":" + mm + ":" + ss;
var id1 = document.getElementById('res'); id1.style.fontSize = "16pt"; id1.style.background = "navy"; id1.style.color = "white"; id1.style.textAlign = "center"; id1.innerHTML = nowtime;
}
function displayClock() { setInterval("getTime();", 1000); }